add_compile_options(-Wno-invalid-source-encoding) # 忽略 gbk 编码警告

cmake_minimum_required(VERSION 3.10)
project(superunzip LANGUAGES CXX)  # 声明项目使用 C++
set(CMAKE_CXX_STANDARD 20)        # 指定 C++20
set(CMAKE_CXX_STANDARD_REQUIRED ON)  # 强制要求编译器支持 C++20
set(CMAKE_CXX_EXTENSIONS ON)     # 禁用编译器扩展（如 GNU 的 `-std=gnu++20`）

# 查找依赖库
find_package(fmt CONFIG REQUIRED)
find_package(libzip CONFIG REQUIRED)
find_package(unofficial-bit7z CONFIG REQUIRED)

file(GLOB_RECURSE CPP_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")

# 打印文件列表（调试用）
message(STATUS "Found CPP files: ${CPP_FILES}")

# 定义可执行文件
add_executable(superunzip ${CPP_FILES})

target_link_libraries(superunzip PRIVATE 
    fmt::fmt 
    libzip::zip 
    unofficial::bit7z::bit7z
)

# 引入 DLL 拷贝逻辑
include(${CMAKE_CURRENT_SOURCE_DIR}/build_scripts/CopyDLLs.cmake)